package controllers

import (
	"github.com/astaxie/beego"
	"test/models"
	"time"
)

type TestMongoController struct {
	beego.Controller
	packages models.Packages
}


func (c *TestMongoController) Get() {
	//orm.RegisterDataBase("default", "mysql", "root:a123456@tcp(120.78.222.112)")
	//orm.RegisterModel(new)
	//bankId := c.Ctx.Input.Param(":bankId")

	//c.packages.Init("demo")
	//
	//f := make(map[string]interface{})
	//f["title"] = "123324";
	//c.packages.Insert()

	//fmt.Println(c.packages.GetCount())
	//fmt.Println(c.packages.FindAll(f))
	//beego.AppConfig.String('')

	notifyInfoModel := models.NotifyInfo{}

	t := time.Now()

	data := make(map[string]interface{})
	data["date"] = t.Unix()

	notifyInfoModel.SaveInfo(data)

	//c.Ctx.WriteString("123")

	//
	c.Ctx.WriteString(`<html><form action="/test_input" method="post">
				<input type="text" name="Username" />
				<input type="password" name="Password" />
				<input type="submit" value="提交" />
			</form> </html>`)
	//c.Data["Website"] = "beego.me"
	//c.Data["Output"] = "astaxie@gmail.com"

	//c.Ctx.Output.Body([]byte("hello world"))
	//c.TplName = "index.tpl"
}


func (c *TestMongoController) Post() {

}